wayland: fix up/down mix up in discrete events
authorOlivier Fourdan <ofourdan@redhat.com>
Tue, 3 May 2016 08:44:16 +0000 (10:44 +0200)
committerOlivier Fourdan <ofourdan@redhat.com>
Tue, 3 May 2016 09:38:06 +0000 (11:38 +0200)
commite74ecfe22e75cf4ec57b36738a66d1fba2d6fd5c
tree384c827ba9f4c1e0ff7c59074a2d745c12920cc3
parentbe201a5b71c7ce73ffd1fc8f1c6c264d82be9d95
wayland: fix up/down mix up in discrete events

The wayland specification for discrete step information for scroll and
other axes reads:

| The discrete value carries the directional information. e.g. a
| value of -2 is two steps towards the negative direction of this axis.

mutter sets a value of 1 for SCROLL_DOWN events and -1 for SCROLL_UP
events.

gdkdevice Wayland backend does the opposite, it translates a positive
discrete value as SCROLL_UP and a negative value as SCROLL_DOWN, which
ends up inverting the scrolling direction.

Fix the logic in gdkdevice Wayland to use a positive value as
SCROLL_DOWN and a negative value as SCROLL_UP so that it matches mutter
and weston logic.

https://bugzilla.gnome.org/show_bug.cgi?id=765907
gdk/wayland/gdkdevice-wayland.c